/****************************************************************************
*  Title: tb.sc
*  Author: Anthony Schaefer, Umar Butt, Talha Ansari
*  Date: 04/01/2010
*  Description: Top level behavior for simple calculator project
****************************************************************************/

#include <stdio.h>


import "design";
import "inputoutput";
//import "c_queue";
import "communication";


const unsigned long SIZE = 100;

behavior Main
{
	
	c_double_handshake firstData;
	c_double_handshake operatorData;
	c_double_handshake secondData;
	c_double_handshake outputData;
	/* if want to use with c_queue somehow */
	//c_queue firstData ((SIZE));
	//c_queue operatorData ((SIZE));
	//c_queue secondData ((SIZE));
	//c_queue outputData((SIZE));
	
	inputoutput IO(firstData, operatorData, secondData, outputData);
	design calc(firstData, operatorData, secondData, outputData);

	int main (void)
	{
		par {
			IO.main();
			calc.main();
		}

		return 0;
	}

	

/**************************
Simple Calculator C Code
**************************/
/*
int main(void)
{
	float a, b, c;
	char d;
	
	while (1)
	{
		printf("Enter the first number: ");
		scanf("%f",&a);
		getchar();
		
		printf("Enter operator (/, *, +, -): ");
		scanf("%c",&d);
		getchar();
		
		printf("Enter the second number: ");
		scanf("%f",&b);
		getchar();
		
		//printf("set the limit");
		//scanf("%f",&c);
		//getchar();

		if (d=='*')
		{
			c=a*b;
		}
		
		if (d=='/')
		{
			c=a/b;
		}
		
		if (d=='+')
		{
			c=a+b;
		}
		
		if (d=='-')
		{
			c=a-b;
		}
		
		printf("Answer is %f \n\n",c);
	}
	//printf("final value is %f",c);
	//getchar();
	//main();
}
*/



};
